package com.fizzkai.p2p.website.controller;

import com.fizzkai.p2p.bussness.service.IBidRequestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class MainController {

    @Autowired
    private IBidRequestService bidRequestService;

    @RequestMapping("/main")
    public String main(Model model){
        // publishPendngBidRequests 待发标 借款单的 列表
        model.addAttribute("publishPendngBidRequests", bidRequestService.queryPublicPendingBidRequest());
        // bidRequests 已发标的 信用标列表
        model.addAttribute("bidRequests", bidRequestService.queryNormalIndexData());
        // expBidRequests 已发标的 体验标列表
        model.addAttribute("expBidRequests", bidRequestService.queryExpIndexData());
        return "main";

    }
}
